package com.itheima.order.controller;

import com.itheima.common.pojo.TbOrder;
import com.itheima.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @作者 itcast
 * @创建日期 2020/10/11 15:32
 **/
@RestController
@RequestMapping("order")
public class OrderController {
    @Autowired
    OrderService orderService;
    @GetMapping("{username}")
    public List<TbOrder> findOrderByUsername(@PathVariable("username") String username){
        return orderService.findOrderByUsername(username);
    }
}
